From cfb205ce1669ae1f67b681beda3a2f9bcaddf1bf Mon Sep 17 00:00:00 2001 From: "vhanquez@kneesa.uk.xensource.com" Date: Thu, 16 Feb 2006 16:19:38 +0000 Subject: [PATCH] When xc_linux_build fails without a meaninful errno, force errno to EINVAL avoid message "Error creating domain: (0, 'Error')" in the case domU version is too old or too new. Signed-off-by: Vincent Hanquez --- tools/python/xen/lowlevel/xc/xc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index d7cc20a274..1a3431e2b1 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -347,9 +347,11 @@ static PyObject *pyxc_linux_build(XcObject *self, if ( xc_linux_build(self->xc_handle, dom, image, ramdisk, cmdline, flags, store_evtchn, &store_mfn, - console_evtchn, &console_mfn) != 0 ) + console_evtchn, &console_mfn) != 0 ) { + if (!errno) + errno = EINVAL; return PyErr_SetFromErrno(xc_error); - + } return Py_BuildValue("{s:i,s:i}", "store_mfn", store_mfn, "console_mfn", console_mfn); -- 2.30.2